<%-- 
    Document   : monPanier
    Created on : May 26, 2012, 2:59:46 PM
    Author     : Marcouss
--%>

<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!-- Ne pas oublier cette ligne sinon tous les tags de la JSTL seront ignorés ! -->  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
  
<html>
    <head>
        <link rel="stylesheet" type="text/css" media="all" href="style2.css"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Vente de DVD en ligne</title> 
    </head>
    <% int total =  0; %>
    
    <body>
        <div id="Global">
            <jsp:include page="header.jsp" />
            <div id="body">
                <jsp:include page="leftBar.jsp"/>
                
            <div id="centerBody">
                <h5>Mon Panier</h5> 
                <c:forEach var="d" items="${requestScope['listeDvd']}">   
                    <form action="ServletPanier" method="get"> 
                        <div id="dvd">
                        <img id="dvdimg" src=${d.photo} />
                        <p>Movie Name : ${d.titre}</p>  
                        <p>Directors :
                        <c:forEach var="r" items="${d.listRealisateur}">
                         ${r.nom} ${r.prenom}  <!-- {}-->
                        </c:forEach></p>
                        <p>Actors :
                        <c:forEach var="a" items="${d.listActeur}">
                         ${a.nom} ${a.prenom} <!-- {}-->
                        </c:forEach> </p> 
                        <p>Year : ${d.annee}</p>
                        <p>genre : ${d.genre}</p>
                        <p>Description : ${d.description}</p>
                        <p>Price : ${d.prix}€</p>
                        <input type="hidden" name="price" value="${d.prix}"/>
                        <input type="hidden" name="action" value="removeDvd"/>  
                        <input type="submit" value="Remove" name="submit"/> 
                        <input type="hidden" name="idDvd" value=${d.id} />
                    </div>
                    </form>
               </c:forEach>
            </div>
    
<div id="rightSideBar">
                    <h2>My Cart</h2>  
                    <img src="images/cart.png"/>
                    
                    <p>Dvds in my Cart : </p>
                    <c:forEach var="d" items="${requestScope['listeDvd']}">   
                    <form action="ServletPanier" method="get"> 
                        <div id="dvdCart">
                        <p>Titre du film : ${d.titre} <br> Price : ${d.prix}€ </p>
                        <p> Quantité : </P>
                        <input type="hidden" name="action" value="removeQtty"/>  
                        <input type="submit" value="-" name="submit"/> 
                        <input type="hidden" name="idDvd" value=${d.id} />
                    </form>
                    
                    <form action="ServletPanier" method="get"> 
                        <input type="hidden" name="action" value="addQtty"/>  
                        <input type="submit" value="+" name="submit"/> 
                        <input type="hidden" name="idDvd" value=${d.id} />
                       </form> 
                    </div>
               </c:forEach>
                    <form action="ServletPanier" method="get">
                        <% double totalDvd = Double.parseDouble((String) session.getAttribute("totalDvd")); 
                            out.println("Total = " + totalDvd + "€");%>
                        <input type="hidden" name="action" value="checkOut"/>  
                        <input type="submit" value="Check Out Now!" name="submit"/> 
                        <input type="hidden" name="idDvd" value=${d.id} />
                        </form>
</div>
            
            </div>
          <jsp:include page="footer.jsp" />
         
          